package hflyeer.gitee.com.service.impl;

import hflyeer.gitee.com.dao.EmployeeDao;
import hflyeer.gitee.com.entity.Employee;
import hflyeer.gitee.com.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("employeeService")
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeDao dao;

    public void insert(Employee employee) {
        employee.setPassword("000000");
        dao.insert(employee);
    }

    public void delete(String sn) {
        dao.delete(sn);
    }

    public void update(Employee employee) {
        dao.update(employee);
    }

    public Employee get(String sn) {
        return dao.get(sn);
    }

    public List<Employee> getAll() {
        return dao.getAll();
    }
}
